home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / fido / mmail.000 / mmail / mmail.0.1 / interface / help.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-27  |  4.1 KB  |  163 lines

  1. /*
  2.  * MultiMAIL offline mail reader
  3.  * 
  4.  
  5.    Written by Kolossvary Tamas (thomas@vma.bme.hu)
  6.  
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 2, or (at your option)
  10.    any later version.
  11.  
  12.    This program is distributed in the hope that it will be useful,
  13.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.    GNU General Public License for more details.
  16.  
  17.    You should have received a copy of the GNU General Public License
  18.    along with this program; if not, write to the Free Software
  19.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. #include "interface.h"
  22.  
  23. extern    mmail        mm;
  24. extern    AreaListWindow    areas;
  25.  
  26.  
  27. HelpWindow :: HelpWindow(void)
  28. {
  29.  active = 0;
  30. }
  31.  
  32. void HelpWindow :: redraw(void)
  33. {
  34.  if(active)
  35.  {
  36.   touchwin(menu);
  37.   wnoutrefresh(menu);
  38.  }
  39. }
  40.  
  41. void HelpWindow :: packetlist(void)
  42. {
  43.  menu=newwin(3, COLS-4, LINES-4, 2);
  44.  init_pair(4, COLOR_YELLOW, COLOR_BLACK);
  45.  init_pair(5, COLOR_WHITE, COLOR_BLACK);
  46.  wattrset(menu, COLOR_PAIR(4) | A_BOLD);
  47.  mvwaddstr(menu, 0, 0, "Q");
  48.  mvwaddstr(menu, 0, 20,"Enter");
  49.  mvwaddstr(menu, 0, 45,"A");
  50.  wattrset(menu, COLOR_PAIR(5) | A_BOLD);
  51.  mvwaddstr(menu, 0, 1,  ": Quit");
  52.  mvwaddstr(menu, 0, 25, ": Select packet");
  53.  mvwaddstr(menu, 0, 46, ": Addressbook");
  54.  
  55.  wnoutrefresh(menu);
  56.  active = 1;
  57. }
  58.  
  59. void HelpWindow :: arealist(void)
  60. {
  61.  menu=newwin(3, COLS-4, LINES-4, 2);
  62.  init_pair(4, COLOR_YELLOW, COLOR_BLACK);
  63.  init_pair(5, COLOR_WHITE, COLOR_BLACK);
  64.  wattrset(menu, COLOR_PAIR(4) | A_BOLD);
  65.  mvwaddch(menu, 0, 0,   'Q');
  66.  mvwaddstr(menu, 0, 29, "Enter");
  67.  mvwaddch(menu, 0, 57,  'A');
  68.  mvwaddch(menu, 1, 0,   'E'); 
  69.  
  70.  mm.areaList->gotoArea(REPLY_AREA);
  71.  if(mm.areaList->getNoOfLetters() > 0)
  72.     mvwaddstr(menu, 1, 32,  "F2");
  73.  
  74.  wattrset(menu, COLOR_PAIR(5) | A_BOLD);
  75.  mvwaddstr(menu, 0, 1,  ": Go to Packet Selection");
  76.  mvwaddstr(menu, 0, 34, ": Select area");
  77.  mvwaddstr(menu, 0, 58, ": Addressbook");
  78.  mvwaddstr(menu, 1, 1,  ": Enter letter to area");
  79.  
  80.  if(mm.areaList->getNoOfLetters() > 0)
  81.     mvwaddstr(menu, 1, 34,    ": Create reply packet");
  82.  areas.Reset_areaList();
  83.  
  84.  wnoutrefresh(menu);
  85.  active = 1;
  86. }
  87.  
  88. void HelpWindow :: letterlist(void)
  89. {
  90.  reply_area_letterlist();
  91.  mvwaddstr(menu, 1, 1, ": Enter letter in area");
  92.  wattrset(menu, COLOR_PAIR(4) | A_BOLD);
  93.  mvwaddch(menu, 1, 0, 'E');
  94.  
  95.  wnoutrefresh(menu);
  96.  active = 1;
  97. }
  98.  
  99. void HelpWindow :: reply_area_letterlist(void)
  100. {
  101.  menu=newwin(3, COLS-4, LINES-4, 2);
  102.  wattrset(menu, COLOR_PAIR(4) | A_BOLD);
  103.  mvwaddch(menu, 0,  0, 'Q');
  104.  mvwaddstr(menu, 0, 26, "Enter");
  105.  mvwaddch(menu, 0, 49, 'S');
  106.  mvwaddch(menu, 1, 30, 'A');
  107.  wattrset(menu, COLOR_PAIR(5) | A_BOLD);
  108.  mvwaddstr(menu, 0,  1, ": Back to arealist");
  109.  mvwaddstr(menu, 0, 31, ": Read letter");
  110.  mvwaddstr(menu, 0, 50, ": Save all letters in area");
  111.  mvwaddstr(menu, 1, 31, ": Addressbook");
  112.  
  113.  wnoutrefresh(menu);
  114.  active = 1;
  115. }
  116.  
  117. void HelpWindow :: letter(void)
  118. {
  119.  int i;
  120.  
  121.  init_pair(61, COLOR_WHITE, COLOR_BLUE);
  122.  init_pair(62, COLOR_YELLOW, COLOR_BLUE);
  123.  menu=newwin(12, 60, 8, 10);
  124.  wattrset(menu, COLOR_PAIR(61) | A_BOLD);
  125.  for(i=0; i<(12*60); i++)
  126.     waddch(menu, ' '); 
  127.  wborder(menu, 0, 0, 0, 0, 0, 0, 0, 0);
  128.  wattrset(menu, COLOR_PAIR(62) | A_BOLD);
  129.  mvwaddstr(menu, 1, 2, "S - save letter");
  130.  mvwaddstr(menu, 2, 2, "R - reply to letter");
  131.  mvwaddstr(menu, 3, 2, "O - reply to original sender");
  132.  mvwaddstr(menu, 4, 2, "E - enter letter");
  133.  mvwaddstr(menu, 5, 2, "N - netmail reply");
  134.  mvwaddstr(menu, 7, 2, "A - addressbook");
  135.  
  136.  wnoutrefresh(menu);
  137.  active = 1;
  138. }
  139.  
  140. void HelpWindow :: reply_area_letter(void)
  141. {
  142.  int i;
  143.  
  144.  init_pair(61, COLOR_WHITE, COLOR_BLUE);
  145.  init_pair(62, COLOR_YELLOW, COLOR_BLUE);
  146.  menu=newwin(12, 60, 8, 10);
  147.  wattrset(menu, COLOR_PAIR(61) | A_BOLD);
  148.  for(i=0; i<(12*60); i++)
  149.         waddch(menu, ' ');
  150.  wborder(menu, 0, 0, 0, 0, 0, 0, 0, 0);
  151.  wattrset(menu, COLOR_PAIR(62) | A_BOLD);
  152.  mvwaddstr(menu, 1, 2, "K - kill letter");
  153.  mvwaddstr(menu, 3, 2, "A - addressbook");
  154.  wnoutrefresh(menu);
  155.  active = 1;
  156. }
  157.  
  158. void HelpWindow :: Delete(void)
  159. {
  160.  delwin(menu);
  161.  active = 0;
  162. }
  163.